<?php

class pngImage extends ImageAdapter implements InterfacePhpthumb {
	
    public function CreateThumb(){
      $Orignalimgage =imagecreatefrompng($this->_sourcepath);
      $width = imagesx($Orignalimgage );
      $height = imagesy($Orignalimgage );
     	
      $thumbwidth = $this->_thumbw;
     // $thumbheight = floor( $height * ( $thumbwidth / $width ) );
      $thumbheight=$this->_thumbh;
      $tmpimg = imagecreatetruecolor( $thumbwidth, $thumbheight );
      imagecopyresized( $tmpimg, $Orignalimgage, 0, 0, 0, 0, $thumbwidth, $thumbheight, $width, $height );
      $tempImageName=Tools::randomValue().'.png';
      if(imagejpeg($tmpimg,$tempImageName))
      	return $tempImageName;
      else
      	return FALSE;
    }
}

?>